#include <iostream>
using std::cout;
using std::endl;

class Point
{
public:
    /* explicit//禁止隐式转换 */
    Point(int x,int y = 0)
    : _ix(x)
    , _iy(y)
    {
        cout << "Point(int,int)" << endl;
    }

    ~Point(){
        cout << "~Point()" << endl;
    }

    Point(const Point & rhs)
    : _ix(rhs._ix)
    , _iy(rhs._iy)
    {}

    Point & operator=(const Point & rhs){
        _ix = rhs._ix;
        _iy = rhs._iy;
        return *this;
    }

    void print() const{
             cout << "(" << this->_ix
            << "," << this->_iy
            << ")" << endl;
    }
private:
    int _ix;
    int _iy;
};


void test0(){
    Point pt(1,8);
    Point pt2(2);
    Point pt3(1);

    //隐式转换
    //Point pt4 = Point(4);
    Point pt4 = 4;
    pt4.print();

    //pt3 = Point(7);
    pt3 = 7;
    pt3.print();
}

int main(void){
    test0();
    return 0;
}
